package cn.boundtw2.yccl.Demo01;

import java.io.FileNotFoundException;
import java.io.IOException;

public class Demo01throws {
    public static void main(String[] args) throws FileNotFoundException,IOException{
        redaFile(("c:\\a.txt"));
    }
    public static void redaFile(String fileName) throws FileNotFoundException,IOException{
        if(!fileName.equals("c:\\a.txt")){
            throw new FileNotFoundException("传递的文件路径不是c:\\a.txt");
        }
        if(!fileName.endsWith(".txt")){
            throw new IOException("文件的后缀名错误");
        }
        System.out.println("文件没有问题");
    }
}
